import request from "@/utils/request";
import qs from "qs";

interface User {
  phone: string;
  password: string;
}

export const login = (data: User) => {
  return request({
    method: "POST",
    // headers: {
    //   "content-type": "application/x-www-form-urlencoded",
    // },
    url: "/front/user/login",

    // data是普通对象 类型就是application/json
    // data是qs转换的 就可以application/x-www-form-urlencoded
    // data是qs转换的 如果是FormData对象 则 multipart/form-data
    data: qs.stringify(data),
  });
}

export const getUserInfo = () => {
  return request({
    method: "POST",
    url: "/front/user/getInfo",
  })
}

export const getUserPages = (data: unknown) => {
  return request({
    method: "POST",
    url: "/boss/user/getUserPages",
    data
  })
}